package com.itheima.springbootwebtlias.config;

import com.itheima.springbootwebtlias.mapper.DeptMapper;
import com.itheima.springbootwebtlias.service.DeptService;
import org.dom4j.io.SAXReader;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration //标识当前类是一个配置类
public class Dom4jConfig {

    //定义bean方法，管理第三方bean
    @Bean
    public SAXReader getSaxReader(DeptService deptService, DeptMapper deptMapper){
        //创建需要交给IOC容器管理的对象
        SAXReader saxReader = new SAXReader();
        //需要设置deptService属性
        //saxReader.setDeptService(deptService);
        //saxReader.setDeptMapper(deptMapper);
        //System.out.println(deptService);
        //System.out.println(deptMapper);

        return saxReader;
    }

}
